package com.pi.config.dao.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.pi.comm.mapper.BaseMapper;
import com.pi.config.dao.entity.BaseNameIdxEntity;

/**
 * 表base_name_idx的mapper类
 *
 */
public interface BaseNameIdxMapper extends BaseMapper<BaseNameIdxEntity, Long>{
    
    public void batchInsert(List<BaseNameIdxEntity> list);
    
    @Select({"<script>",
    "SELECT id,create_date,update_date,version,name_type,"
    + "name_id,name_cache,state FROM base_name_idx WHERE name_type=#{nameType} AND ",
    " <foreach item='item' index='index' collection='nameKeyList' ",
    "open='(' separator='OR' close=')'>INSTR(name_cache, #{item})</foreach>",
    "</script>"})
    public List<BaseNameIdxEntity> queryNameIdxByNameKey(@Param("nameType") Integer nameType, @Param("nameKeyList") List<String> nameKeyList);
}